package com.goodwill.androidtest.threadtest;


public class ThreadA extends Thread {

    private Object lock;

    public ThreadA(Object lock) {
        this.lock = lock;
    }

    @Override
    public void run() {
        super.run();
        synchronized (lock) {
            try {
                System.out.println("wait begin: " + Thread.currentThread().getName());
                lock.wait();
                System.out.println("wait end: " + Thread.currentThread().getName());
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
    }
}
